package org.xxpay.pay.channel.xkpay;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;
import org.xxpay.common.unify.AbstractPaymentConfig;

public class XkConfig extends AbstractPaymentConfig {
    public static final String CHANNEL_NAME = "xk";
    public static final String CHANNEL_NAME_XK_QUICK = CHANNEL_NAME + "_quick";
    public static final String CHANNEL_NAME_JD_QR = CHANNEL_NAME + "_jd_qr";
    public static final String CHANNEL_NAME_UNION_QR = CHANNEL_NAME + "_union_qr";
    public static final String RETURN_VALUE_SUCCESS = "0000";
    public static final String RESPONSE_RESULT_SUCCESS = "success";
    XkConfig(String payParam) {
        Assert.notNull(payParam, "init kx config error");
        JSONObject object = JSON.parseObject(payParam);
        setMchId(object.getString("mchId"));
        setPrivateKey(object.getString("privateKey"));
        setRequestUrl(object.getString("requestUrl"));
        setPayMode(object.getString("payMode"));
    }
}
